﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="IStudyDefinitionManagementService.cs" company="ELEN 7045.GROUP 2">
//   Contributed by E.V.
// </copyright>
// <summary>
//   Defines the IStudyDefinitionManagementService type.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace Domain.StudyDefinition.Services.Contracts
{
    using System.Collections.Generic;

    using Domain.Setup.Entities;
    using Domain.StudyDefinition.Entities;

    /// <summary>
    /// Defines the IStudyDefinitionManagementService type.
    /// </summary>
    public interface ITemporaryStudyDefinitionDomainService
    {
        /// <summary>
        /// Adds the study.
        /// </summary>
        /// <param name="study">
        /// The study.
        /// </param>
        /// <returns>
        /// The added study.
        /// </returns>
        Study AddStudy(Study study);

        /// <summary>
        /// Updates the study.
        /// </summary>
        /// <param name="study">The study.</param>
        void UpdateStudy(Study study);

        /// <summary>
        /// Deletes the study.
        /// </summary>
        /// <param name="study">The study.</param>
        void DeleteStudy(Study study);

        /// <summary>
        /// Archives the study.
        /// </summary>
        /// <param name="study">The study.</param>
        void ArchiveStudy(Study study);

        /// <summary>
        /// Gets all Studies.
        /// </summary>
        /// <returns>A list of Studies</returns>
        List<Study> GetAllStudies();

        /// <summary>
        /// Gets all studies without treatments.
        /// </summary>
        /// <returns></returns>
        List<Study> GetAllStudiesWithoutTreatments();


        /// <summary>
        /// Adds the subject group.
        /// </summary>
        /// <param name="subjectGroup">The subject group.</param>
        /// <returns>The added subject group</returns>
        SubjectGroup AddSubjectGroup(SubjectGroup subjectGroup);

        /// <summary>
        /// Updates the subject group.
        /// </summary>
        /// <param name="subjectGroup">The subject group.</param>
        void UpdateSubjectGroup(SubjectGroup subjectGroup);

        /// <summary>
        /// Deletes the subject group.
        /// </summary>
        /// <param name="subjectGroup">The subject group.</param>
        void DeleteSubjectGroup(SubjectGroup subjectGroup);

        /// <summary>
        /// Gets all subject groups.
        /// </summary>
        /// <returns>A list of subject groups</returns>
        List<SubjectGroup> GetAllSubjectGroups();

        /// <summary>
        /// Gets all non parented subject groups.
        /// </summary>
        /// <returns>A list of subject groups</returns>
        List<SubjectGroup> GetAllNonParentedSubjectGroups();

        /// <summary>
        /// Adds the treatment.
        /// </summary>
        /// <param name="treatment">The treatment.</param>
        /// <returns>The added treatment</returns>
        Treatment AddTreatment(Treatment treatment);

        /// <summary>
        /// Updates the treatment.
        /// </summary>
        /// <param name="treatment">The treatment.</param>
        void UpdateTreatment(Treatment treatment);

        /// <summary>
        /// Deletes the treatment.
        /// </summary>
        /// <param name="treatment">The treatment.</param>
        void DeleteTreatment(Treatment treatment);

        /// <summary>
        /// Gets all treatment.
        /// </summary>
        /// <returns>A list of treatments</returns>
        List<Treatment> GetAllTreatment();

        /// <summary>
        /// Gets all treatments without subject groups.
        /// </summary>
        /// <returns>A list of treatments</returns>
        List<Treatment> GetAllTreatmentsWithoutSubjectGroups();

        /// <summary>
        /// Gets all treatment non parented treatments.
        /// </summary>
        /// <returns>A list of treatments</returns>
        List<Treatment> GetAllNonParentedTreatments();

        /// <summary>
        /// Adds the subject group to study.
        /// </summary>
        /// <param name="treatment"></param>
        /// <param name="subjectGroup">The subject group.</param>
        /// <returns>The modified Study</returns>
        Study AddSubjectGroupToTreatment(Treatment treatment, SubjectGroup subjectGroup);

        /// <summary>
        /// Removes the subject group from study.
        /// </summary>
        /// <param name="study">The study.</param>
        /// <param name="subjectGroup">The subject group.</param>
        void RemoveSubjectGroupFromStudy(Study study, SubjectGroup subjectGroup);

        /// <summary>
        /// Removes the treatment from subject group.
        /// </summary>
        /// <param name="subjectGroup">The subject group.</param>
        /// <param name="treatment">The treatment.</param>
        void RemoveSubjectGroupFromTreatment(SubjectGroup subjectGroup, Treatment treatment);

        /// <summary>
        /// Moves the subject group to a new location.
        /// </summary>
        /// <param name="subjectGroup">The subject group.</param>
        /// <param name="location">The new location.</param>
        /// <returns>The modified study</returns>
        SubjectGroup MoveSubjectGroupToNewLocation(SubjectGroup subjectGroup, Location location);

        // void MarkStudyAsArchivable(Study study);

        void LockStudy(Study study);

        void UnlockStudy(Study study);
    }
}
